package com.joker.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.joker.entity.ChatSession;
import com.joker.entity.SessionAndUser;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * <p>
 * 会话表 Mapper 接口
 * </p>
 *
 * @author joker
 * @since 2021-06-03
 */
@Component
public interface ChatSessionMapper extends BaseMapper<ChatSession> {
    @Update("UPDATE chat_session SET un_read_count = 0 WHERE user_id = #{userId} and to_user_id = #{toUserId}")
    public Integer setUnReadCountByUserIdAndToUserId(String userId, String toUserId);
}
